package com.meilele.dao.zhengchao;

import com.meilele.entity.zhengchao.FourIndexImage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface FourIndexImageMapper {
    @Delete({
        "delete from four_index_image",
        "where index_image_id = #{indexImageId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer indexImageId);

    @Insert({
        "insert into four_index_image (index_image_id, index_image)",
        "values (#{indexImageId,jdbcType=INTEGER}, #{indexImage,jdbcType=CHAR})"
    })
    int insert(FourIndexImage record);

    int insertSelective(FourIndexImage record);

    @Select({
        "select",
        "index_image_id, index_image",
        "from four_index_image",
        "where index_image_id = #{indexImageId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.zhengchao.FourIndexImageMapper.BaseResultMap")
    FourIndexImage selectByPrimaryKey(Integer indexImageId);

    int updateByPrimaryKeySelective(FourIndexImage record) throws Exception;

    @Update({
        "update four_index_image",
        "set index_image = #{indexImage,jdbcType=CHAR}",
        "where index_image_id = #{indexImageId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FourIndexImage record);
    @Select("select index_image_id, index_image from four_index_image")
    @ResultMap("com.meilele.dao.zhengchao.FourIndexImageMapper.BaseResultMap")
    List<FourIndexImage> findAll();
}